package com.ddn.controller.hall;

import com.ddn.service.hall.ConferenceService;
import com.ddn.util.R;
import com.ddn.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/*
  ❀❀❀---扎根---❀❀❀
    ❤ @libing ❤
  
*/
@RestController
@RequestMapping("/conference")
public class ConferenceController {

    @Autowired
    private ConferenceService conferenceService;

    /**
     * 查找全部的会议厅信息
     * @param map
     * @return
     */
    @RequestMapping("/list")
    public ResultData conferenceList(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = conferenceService.findAllConference(map);
        return resultData;
    }

    /**
     * 删除会议厅信息
     * @param map
     * @return
     */
    @RequestMapping("/delete")
    public ResultData conferenceDelete(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = conferenceService.deleteConference(map);
        return resultData;
    }

    /**
     * 增加报告厅信息
     * @param map
     * @return
     */
    @RequestMapping("/add")
    public ResultData addConference(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = conferenceService.addConference(map);
        return resultData;
    }

    /**
     * 增加报告厅信息
     * @param map
     * @return
     */
    @RequestMapping("/update")
    public ResultData updateConference(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = conferenceService.updateConference(map);
        return resultData;
    }

    /**
     * 批量删除报告厅信息
     * @param ids
     * @return
     */
    @RequestMapping("/batch")
    public ResultData batchConference(@RequestParam List<Integer> ids) {
        System.out.println(ids);
        ResultData resultData = conferenceService.batchConference(ids);
        return resultData;
    }

    /**
     * 动态下拉框
     */
    @RequestMapping("/select")
    public ResultData selectConSubject() {
        ResultData resultData = conferenceService.selectConSubject();
        return resultData;
    }

    /**
     * 柱状图
     * @return
     */
    @RequestMapping("/bar")
    public ResultData barConSubject() {
        ResultData resultData = conferenceService.barConSubject();
        return resultData;
    }

    /**
     * 饼状图
     * @return
     */
    @RequestMapping("/pie")
    public ResultData pieConSubject() {
        ResultData resultData = conferenceService.pieConSubject();
        return resultData;
    }
}
